/**
 * 
 */
package implementations;

import interfaces.Edge;
import interfaces.Vertex;

import java.util.Collection;

/**
 * @author Kai Bielenberg (kai.bielenberg@haw-hamburg.de)
 * @param <E>
 *
 */
public class DirectedEdge<E,V> extends AbstractEdge<E, V> {


    
    private DirectedEdge(String name, Vertex<V> start, Vertex<V> end, E element) {
        this.name = name;
        this.start = start;
        this.end = end;
        this.element = element;
    }
    
    static <E, V> DirectedEdge<E, V> valueOf(String name, Vertex<V> v1,
            Vertex<V> v2, E element) {
        return new DirectedEdge<E, V>(name, v1, v2, element);
    }
    

    @Override
    public boolean areParallel(Edge<E, V> e) {
        recordAccess();
        return this.start().equals(e.start()) && this.end().equals(e.end());
    }
    
    

    @Override
    public boolean isDirected() {
        recordAccess();
        return true;
    }





}
